package com.xiaobai.controller;

import entity.User;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

/**
 * @author yangdaji
 * @version 1.0
 * @Description:
 * @date 22-1-23 下午 11:15
 */
@RefreshScope
@Slf4j
@RestController
@RequestMapping("user")
public class UserController {

    @Value("${name}")
    private String name;

    @RequestMapping("/getUser")
    public List<User> getUser(String userId) {
        log.info("传入id:{}", userId);
        log.info("获取配置文件key:{}",name);

        List<User> list=new ArrayList<>();
        list.add(new User().setName("小组").setSex("男"));
        list.add(new User().setName("小组2").setSex("男"));
        return list;
    }

}


